var productData = [];

var productData_config = []


var _productData_config = [
    {cNum:"1"  ,sNumStart:1, sNumEnd:52},
    {cNum:"2"  ,sNumStart:1, sNumEnd:52},
    {cNum:"3_1",sNumStart:25,sNumEnd:48},
    {cNum:"3_2",sNumStart:1, sNumEnd:24},
    {cNum:"4_1",sNumStart:25,sNumEnd:48},
    {cNum:"4_2",sNumStart:1, sNumEnd:24},
    {cNum:"5_1",sNumStart:25,sNumEnd:48},
    {cNum:"5_2",sNumStart:1, sNumEnd:24},
    {cNum:"6_1",sNumStart:25,sNumEnd:48},
    {cNum:"6_2",sNumStart:1, sNumEnd:24},
    {cNum:"7_1",sNumStart:25,sNumEnd:48},
    {cNum:"7_2",sNumStart:1, sNumEnd:24},
    {cNum:"8_1",sNumStart:25,sNumEnd:48},
    {cNum:"8_2",sNumStart:1, sNumEnd:24},
    {cNum:"9_1",sNumStart:25,sNumEnd:48},
    {cNum:"9_2",sNumStart:1, sNumEnd:24},
    {cNum:"10"  ,sNumStart:1, sNumEnd:52},
    {cNum:"11"  ,sNumStart:1, sNumEnd:52},
    {cNum:"12"  ,sNumStart:1, sNumEnd:52},
    {cNum:"13"  ,sNumStart:1, sNumEnd:52},
    {cNum:"14"  ,sNumStart:1, sNumEnd:60},
    {cNum:"15"  ,sNumStart:1, sNumEnd:32},
    {cNum:"16"  ,sNumStart:1, sNumEnd:32},
    {cNum:"17"  ,sNumStart:1, sNumEnd:72},
    {cNum:"18"  ,sNumStart:1, sNumEnd:72},
    {cNum:"19"  ,sNumStart:1, sNumEnd:72},
    {cNum:"20"  ,sNumStart:1, sNumEnd:72},
    {cNum:"21"  ,sNumStart:1, sNumEnd:36},
    {cNum:"22"  ,sNumStart:1, sNumEnd:36},
    {cNum:"23"  ,sNumStart:1, sNumEnd:36},

]


_productData_config.forEach(el => {
    for(let i=el.sNumStart; i <= el.sNumEnd; i++)
    {
        var temp = {
            buildType:"c"+el.cNum,
            stackType:"s"+i,
            unitNum:Math.ceil(Math.random() * 186),
            totalNum:Math.ceil(Math.random() * 186),
            cc:"斤"
        };
        // var temp = {buildType:"c"+el.cNum,stackType:"s"+i,unitNum:3};
        productData_config.push(temp);
    }
})
// console.log(productData_config)

productData_config.forEach( el => {
    var stacks = {
        name :  el.buildType + "_" + el.stackType,
        buildType:el.buildType,
        stackType:el.stackType,
        unitNum:el.unitNum,
        totalNum:el.totalNum,
        cc:el.cc,
        statck : []
    };
    for(let i=1; i <= el.unitNum ; i++)
    {
        var price = Math.ceil( Math.random() * 100 );
        var temp = {
            // buildType:el.buildType,
            // stackType:el.stackType,
            unitNum:i , //1 - 187垛位编号
            name:"产品"+el.buildType+"-"+el.stackType+"_"+i+"号",
            price:price+"元" ,
            inTime:"2022-05-09",
            level:"优质",
            ownership:el.buildType+"号厂家",
            statusType:Math.floor(Math.random() * 3)  //该产品的状态
        };
        stacks.statck.push(temp);
    }
    productData.push(stacks)
})


export { productData };